#pragma once
#include "tlv_buffer.h"
#include <optional>
#include <string>

class TLVReader {
public:
    explicit TLVReader(const TLVBuffer& buffer);

    std::optional<uint8_t>  readUint8(size_t offset);
    std::optional<uint16_t> readUint16(size_t offset);
    std::optional<uint32_t> readUint32(size_t offset);
    std::optional<std::string> readString(size_t offset);
    std::optional<std::vector<uint8_t>> readBlob(size_t offset);

protected:
    const TLVBuffer& buffer_;
};
